package com.creative.accountsdk.bean;

import org.json.JSONObject;

/**
 * Created by david on 15/11/26.
 */
public class ClassInfo implements Cloneable{

    public long     id;       //班级id
    public String  name;      //班级名称
    public long   gradeId;    //年级id
    public long  schoolId;    //学校id
    public int     nums = 0 ;      //学生总数
    public String  qrcode;    //学生邀请码
    public String  area;      //国家代码
    public long    headerTId; //班主任id
    public  int     remain;   //剩余人数
    public int     type;      //1: 我的班级  2：其他班级

    public ClassInfo  setJsonTovo(JSONObject  json){
        id = json.optLong("id");
        name = json.optString("name");
        gradeId = json.optLong("gradeId");
        schoolId = json.optLong("schoolId");
        nums = json.optInt("nums");
        qrcode = json.optString("qrcode");
        area = json.optString("area");
        remain = json.optInt("remain");
        headerTId = json.optLong("headerTId");
        return this;
    }

    public Object clone() {
        ClassInfo o = null;
        try {
            o = (ClassInfo) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }
}
